Hello everyone,
I'm fairly new to DXL and have what might be a stupid problem, but I've read everything I can find and haven't been able to find a resolution.
I'm trying to access the "Object Number" attribute in my dxl here is my script:
Module m = current
Object o
for o in m do {
print o."Absolute Number" "\t" o."Object Number" "\n"
}
When I try and run this I get an Unknown Object attribute error. I modified my code thinking there might be one or two obejcts that for some reason didn't have it to this:
Module m = current
Object o
for o in m do {
if (exists attribute "Object Number")
print o."Absolute Number" "\t" o."Object Number" "\n"
else
print o."Absolute Number" "\tObject Number Doesn't Exist\n"
}
Every object in the module returned the "Object Number Doesn't Exist" line. So my question is why can't I access this attribute via DXL? I can look at the attributes for an object and see it in the list, but DXL won't recognize it.
Thanks, in advance for all your help.
-Justus
justus - Wed Nov 19 14:15:36 EST 2008 |
|
Re: Unknown Object Attribute Reik_Schroeder - Thu Nov 20 06:53:28 EST 2008
Hi Justus,
there are three "virtual" Object attributes in DOORS GUI:
"Object Identifier" --> in DXL "identifier (Object)"
"Object Number" --> in DXL "number (Object)"
"Object Level" --> in DXL "level (Object)"
so you need to acces them by using above functions identifier, number and level.
Greetings
Reik
|
|
Re: Unknown Object Attribute justus - Thu Nov 20 10:06:48 EST 2008 Reik_Schroeder - Thu Nov 20 06:53:28 EST 2008
Hi Justus,
there are three "virtual" Object attributes in DOORS GUI:
"Object Identifier" --> in DXL "identifier (Object)"
"Object Number" --> in DXL "number (Object)"
"Object Level" --> in DXL "level (Object)"
so you need to acces them by using above functions identifier, number and level.
Greetings
Reik
Thanks Reik!! That is just the info I needed. Just two quick followup questions
1. Are Number, Level and Identifier the only three virtual attributes, or are there more?
2. Is it possible to change the values of these virtual attributes via DXL?
Thanks again!
-Justus
|
|
Re: Unknown Object Attribute Reik_Schroeder - Thu Nov 20 11:43:07 EST 2008 justus - Thu Nov 20 10:06:48 EST 2008
Thanks Reik!! That is just the info I needed. Just two quick followup questions
1. Are Number, Level and Identifier the only three virtual attributes, or are there more?
2. Is it possible to change the values of these virtual attributes via DXL?
Thanks again!
-Justus
Hi Justus,
1)Yes these three attributes are the only ones, that are virtual.
An additional function is lastModifiedTime which gives a more precise value of "Last Modified On" attribute, but here "Last Modified On" is a real existing attribute.
2)No it is not possible to change these values, because they are given by Doors Module structure.
The identifier is as it sounds the absolute unique identifier within the Module. It is created by concatination of Module's attribute "Prefix" and Object's attribute "Absolute Number".
The level and number are evaluated from Objects hierarchy, so the only possebility to modify them is to move the object within this hierarchy.
Greetings
Reik
|
|
Re: Unknown Object Attribute llandale - Fri Nov 21 11:52:29 EST 2008 justus - Thu Nov 20 10:06:48 EST 2008
Thanks Reik!! That is just the info I needed. Just two quick followup questions
1. Are Number, Level and Identifier the only three virtual attributes, or are there more?
2. Is it possible to change the values of these virtual attributes via DXL?
Thanks again!
-Justus
On a side note, the 'number(obj)' of an object can change drastically depending on whether or not deleted objects are showing and the object has deleted older siblings of itself or deleted older siblings of its ancestors. You can test this as follows:
[1] Turn off filtering and sorting
[2] Select the top object, and create an object 'after' it.
[3] Click and drag the top object and move it 'after' the newly created object.
[4] The new object is now first.
[5] Delete the new object, notice it disappears.
[6] Select the top object
[7] Run the attached DXL, which should display the 'number' as <1>.
[8] View menu >> show >> deletions, which will display the deleted object
[9] Without changing objects, run the DXL which should display the 'number' as <2>.
Thus, the number(obj) only really makes sense when deleted objects are not showing. This also creates some problems when you try to get the number of a deleted object; its number will tend to be identical to the number of its older undeleted sibling. You can test that with the 2nd DXL, in a module featuring deleted objects that are not showing.
// ***** BEGIN DXL ****
Object oCurr = current
infoBox((identifier(oCurr)) "\tNumber: <">")
// ***** Begin 2nd DXL ****
Object obj
for obj in entire (current Module) do
{ print (isDeleted(obj)) "\t" (identifier(obj)) "\t<">\n"
}
|
|
Re: Unknown Object Attribute llandale - Fri Nov 21 14:58:02 EST 2008 llandale - Fri Nov 21 11:52:29 EST 2008
On a side note, the 'number(obj)' of an object can change drastically depending on whether or not deleted objects are showing and the object has deleted older siblings of itself or deleted older siblings of its ancestors. You can test this as follows:
[1] Turn off filtering and sorting
[2] Select the top object, and create an object 'after' it.
[3] Click and drag the top object and move it 'after' the newly created object.
[4] The new object is now first.
[5] Delete the new object, notice it disappears.
[6] Select the top object
[7] Run the attached DXL, which should display the 'number' as <1>.
[8] View menu >> show >> deletions, which will display the deleted object
[9] Without changing objects, run the DXL which should display the 'number' as <2>.
Thus, the number(obj) only really makes sense when deleted objects are not showing. This also creates some problems when you try to get the number of a deleted object; its number will tend to be identical to the number of its older undeleted sibling. You can test that with the 2nd DXL, in a module featuring deleted objects that are not showing.
// ***** BEGIN DXL ****
Object oCurr = current
infoBox((identifier(oCurr)) "\tNumber: <">")
// ***** Begin 2nd DXL ****
Object obj
for obj in entire (current Module) do
{ print (isDeleted(obj)) "\t" (identifier(obj)) "\t<">\n"
}
Digressing further... I wrote library function 'string fNumber(Object)' which returns the 'true' paragraph of the object, the one that's displayed when showing deletes are off. It turns off showing deletes, gets the 'number', and turns it back on (if it was on). To do that it needs to get a handle on the object's Module and remember if showing deletes is on. To do that it must remember which module is 'Current', then set the current module to the module in question, then reset the Current Module back to what it was (if there was one). Yuuck.
It gets even worse when you try to run this function in a Layout. If a deleted object is showing and the layout turns off showing deleted objects, then it appears that the 'obj' parameter gets undefined and exception violations ensue. The solution is to detect if we are running in a layout, specifically if 'obj' is non-null but 'attrDXLName' is null, and regrettably get the 'number' without turning off showing deletes.
Yuuuuck.
Such is a day in the live of a Obsessive-Compulsive DXL nerd.
|
|
Re: Unknown Object Attribute SystemAdmin - Wed May 13 07:01:55 EDT 2009 llandale - Fri Nov 21 14:58:02 EST 2008
Digressing further... I wrote library function 'string fNumber(Object)' which returns the 'true' paragraph of the object, the one that's displayed when showing deletes are off. It turns off showing deletes, gets the 'number', and turns it back on (if it was on). To do that it needs to get a handle on the object's Module and remember if showing deletes is on. To do that it must remember which module is 'Current', then set the current module to the module in question, then reset the Current Module back to what it was (if there was one). Yuuck.
It gets even worse when you try to run this function in a Layout. If a deleted object is showing and the layout turns off showing deleted objects, then it appears that the 'obj' parameter gets undefined and exception violations ensue. The solution is to detect if we are running in a layout, specifically if 'obj' is non-null but 'attrDXLName' is null, and regrettably get the 'number' without turning off showing deletes.
Yuuuuck.
Such is a day in the live of a Obsessive-Compulsive DXL nerd.
Is there a way to display or know the date when an object was deleted?
|
|
Re: Unknown Object Attribute Ron_Lewis - Wed May 13 07:34:37 EDT 2009 SystemAdmin - Wed May 13 07:01:55 EDT 2009
Is there a way to display or know the date when an object was deleted?
Look at history for the object in the appropriate baseline.
|
|
Re: Unknown Object Attribute Tony_Goodman - Wed May 13 08:12:41 EDT 2009 SystemAdmin - Wed May 13 07:01:55 EDT 2009
Is there a way to display or know the date when an object was deleted?
You can see object deletions in the module history.
Select File > Module Properties
Select History tab
Click on Show history of "All"
Object deletions are shown with the object's absolute number.
Note the date of the deletion and then you can go to the appropriate baseline to view the obejct as it was before it was deleted.
|
|